Skip to content

enhance: kill superseded history queries when refreshing commits - #2863

Open
bertyhell wants to merge 1 commit into
sourcegit-scm:developfrom
bertyhell:perf/cancel-stale-history-queries
Open

bertyhell wants to merge 1 commit into
sourcegit-scm:developfrom
bertyhell:perf/cancel-stale-history-queries

Conversation

@bertyhell

Copy link
Copy Markdown

Repository.RefreshCommits() cancels the previous refresh, but the token was
never passed to QueryCommits, so a superseded git log (and its follow-up
QueryCurrentBranchCommitHashes) kept running to completion. During bursts of
ref changes (fetching multiple remotes, rebasing) several of them could pile up.

Pass the token to QueryCommits and terminate the running git process when it
is cancelled (via a small Command.TerminateOnCancellation helper), skip the
follow-up query once cancelled, and don't report errors caused by cancellation.

🤖 Generated with Claude Code

`Repository.RefreshCommits()` cancels the previous refresh, but the token was
never passed to `QueryCommits`, so a superseded `git log` (and its follow-up
`QueryCurrentBranchCommitHashes`) kept running to completion. During bursts of
ref changes (fetching multiple remotes, rebasing) several of them could pile up.

Pass the token to `QueryCommits` and terminate the running git process when it
is cancelled (via a small `Command.TerminateOnCancellation` helper), skip the
follow-up query once cancelled, and don't report errors caused by cancellation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KCxH1zwDXLd9kfAAkcf6PZ

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants